export default {
  props: {
    value: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  data() {
    return {
      formData: {},
      labelWidth: "75px"
    };
  },
  computed: {
    merged() {
      return { ...this.value, ...this.formData };
    }
  },
  methods: {
    handleInput(name, [value]) {
      this.formData[name] = value;
      this.$emit("input", this.merged);
    },
    handleHidden(value) {
      this.formData.hidden = !value;
      this.$emit("input", this.merged);
    },
    handleDisabled(value) {
      this.formData.disabled = !value;
      this.$emit("input", this.merged);
    }
  }
};
